from flask import Flask,request
from flask import render_template
from reserch import reserch4letters

app = Flask(__name__)

@app.route('/',methods=['GET', 'POST'])
def index():  # put application's code here
    return render_template("index.html")

@app.route('/login',methods=['GET'])
def user_login():  # put application's code here
    return render_template("login.html")

@app.route('/project_name',methods=['GET', 'POST'])
def full_name():  # put application's code here
    return render_template("project_name.html")

@app.route('/project_vowels',methods=['GET'])
def vowels():  # put application's code here
    return render_template("project_vowels.html")

@app.route('/vowels1',methods=['GET'])
def vowels1():  # put application's code here
    return render_template("vowels1.html")

@app.route('/project_cart',methods=['GET'])
def cart():  # put application's code here
    return render_template("project_cart.html")

@app.route('/project_schedule',methods=['GET'])
def schdeule():  # put application's code here
    return render_template("project_schedule.html")

@app.route('/schedule1',methods=['GET'])
def schedule1():  # put application's code here
    return render_template("schedule1.html")

@app.route('/results_name',methods=['POST'])
def results1():  # put application's code here

    first_name = request.form['firstname']  # 用户输入
    last_name = request.form['lastname']
    full_name = first_name.title() + '' + last_name.title()
    return render_template('results_name.html',
                           fullname=full_name,)

@app.route('/results_vowels',methods=['POST'])
def results2():  # put application's code here
    # py_vowels = request.form['vowels']
    py_word = request.form['word']
    py_found = reserch4letters(py_word)
    return render_template('results_vowels.html',
                           found=py_found)

@app.route('/results_cart1',methods=['GET', 'POST'])
def results3():  # put application's code here
    return render_template('results_cart1.html')

@app.route('/results_schedule',methods=['POST'])
def results4():  # put application's code here
    return render_template('results_schedule.html')

if __name__ == '__main__':
    app.run()
